create or replace view vac_val as
with v as
(
 select
  workspace,
  application_id,
  application_name,
  page_id,
  page_name,
  validation_name,
  to_char(validation_sequence) validation_sequence,
  tabular_form_region_id,
  validation_type,
  validation_expression1,
  validation_expression2,
  always_execute,
  condition_type,
  condition_expression1,
  condition_expression2,
  when_button_pressed,
  when_button_pressed_id,
  validation_failure_text,
  associated_item,
  associated_column,
  error_display_location,
  build_option,
  authorization_scheme,
  authorization_scheme_id,
  last_updated_by,
  last_updated_on,
  component_comment,
  validation_id,
  component_signature,
  'APEX_APPLICATION_PAGE_VAL' src_view_name
 from apex_application_page_val t
)
 select
 workspace,
 application_id,
 application_name,
 page_id, page_name,
 validation_name,
 tabular_form_region_id,
 when_button_pressed_id,
 authorization_scheme_id,
 last_updated_by,
 last_updated_on,
 validation_id,
 component_signature,
 src_view_name,
 u_name, u_value
 from v
  UNPIVOT INCLUDE NULLS ( u_value
   FOR    u_name
   IN
   (
      validation_sequence,
      validation_type,
      validation_expression1,
      validation_expression2,
      always_execute,
      condition_type,
      condition_expression1,
      condition_expression2,
      when_button_pressed,
      validation_failure_text,
      associated_item,
      associated_column,
      error_display_location,
      build_option,
      authorization_scheme,
      component_comment
   )
  );

